package com.learn.mqq.controller;


import cn.hutool.core.util.StrUtil;
import com.learn.mqq.service.ProducerService;
import com.learn.mqq.vo.SendMsgVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/provider")
public class ProviderController {
    @Autowired
    private ProducerService producerService;

    @GetMapping(value = "/send")
    public String send(@RequestParam String message) {
        if (!StrUtil.isEmpty(message)) {
            producerService.sendMessage(message);
            return "success";
        }
        return "error";
    }
}
